require_relative 'pdu'

module SmppClient

  module Pdu

    # BindTransceiver response PDU.

    class BindTransceiverResp < Pdu

      attr_accessor :system_id

      def initialize(byte_buffer = nil)
        if byte_buffer == nil
          super(CommandId::BIND_TRANSCEIVER_RESP)
          @system_id = ''
        else
          super(byte_buffer)
          parse_body(byte_buffer)
          parse_tlvs(byte_buffer)
        end
      end

      def parse_body(byte_buffer)
        @system_id = byte_buffer.remove_cstring
      end

      def body_bytes
        return ByteBuffer.new.append_cstring(@system_id).bytes
      end

    end

  end

end